package com.woniuxy;

/**
 * @Author: 马宇航
 * @Do: 解释耦合
 * @DateTime: 22/08/17/0017 15:01
 * @Component: 成都蜗牛学苑
 **/
class Coupling implements CoupLingInterface{

}
class Coup implements  CoupLingInterface{

}
interface CoupLingInterface{

}
public class NoSpring {
    /**
     * 耦合：NoSpring这个类，必须传入一个Coupling
     * ChangeLog : 1. 创建 (22/08/17/0017 15:03 [马宇航]);
     * @param coupling
     * @return null
    */
    public NoSpring(CoupLingInterface coupling) {
        System.out.println(coupling);
    }

    public static void main(String[] args) {
        NoSpring noSpring = new NoSpring(new Coupling());
        //明天改需求, 要修改这个对应的类，则强耦合会编译报错。可选方案通过接口解耦！
        Coup coup = new Coup();
        NoSpring noSpring1 = new NoSpring(coup);

    }
}
